package com.example.demofdfs.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class UserLogAop {

	@Autowired
	private LogContext logContext;
	
	@Pointcut("execution(* com.example.demofdfs.service.impl.*.*(..)) && !execution(* com.example.demofdfs.service.impl.UserLogServiceImpl.*(..)) ")
	private void pointcut() {}
	
//	@Around("pointcut()")
	public Object log(ProceedingJoinPoint point) throws Throwable {
//		UserLogContext context = new UserLogContext(logService);
		return logContext.request(point);
	}
}
